<?php

namespace App\Models;

use Slowlyo\OwlAdmin\Models\BaseModel as Model;

/**
 * 运营商IP管理
 */
class IpAddresse extends Model
{

	protected $table = 'ip_addresses';

	protected static function boot()
	{
		parent::boot();

		static::creating(function ($model) {
			$model->created_at = date('Y-m-d H:i:s');
			$model->updated_at = date('Y-m-d H:i:s');
			$model->operator_uid = admin_user()->id;
			$model->editor_uid = admin_user()->id;
		});

		static::updating(function ($model) {
			$model->updated_at = date('Y-m-d H:i:s');
			$model->editor_uid = admin_user()->id;
		});
	}
	 /**
     * 获取操作人信息
     */
    public function operator()
    {
        return $this->belongsTo(AdminUser::class, 'operator_uid');
    }
	public function idcnode()
    {
        return $this->belongsTo(Idcnode::class, 'idcnode_id');
    }
	public function up_customer()
    {
        return $this->belongsTo(UpCustomer::class, 'up_customer_id');
    }
	public function upcustomer_bu()
    {
        return $this->belongsTo(UpcustomerBu::class, 'upcustomer_bu_id');
    }
	
}